﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ZedGraph;

namespace erse253_homework
{
    public partial class Covariogram : BaseWindow
    {
        public Covariogram(double[,] data, bool vertical, int tolerance)
        {
            InitializeComponent();
            double[] x;
            double[] y;
            Chart variogram = new Chart();
            variogram.Covariogram(data, out x, out y, vertical, tolerance);
            GenerateGraph(x, y);
        }

        private void GenerateGraph(double[] x, double[] y)
        {
            //the zedGraphControl is a component developed by a third party programmer. (I'm using it here to speed up my development task).
            GraphPane pane = zedGraphControl1.GraphPane;

            pane.Title.Text = "Covariogram";
            pane.XAxis.Title.Text = "Distance |h|";
            pane.YAxis.Title.Text = "Value";

            LineItem myCurve = pane.AddCurve("Covariogram", x, y, Color.Red);
            zedGraphControl1.AxisChange();
        }
    }
}
